vcSignalMap
vcSignalMap is the basic implementation for signal map type behaviors that contain specific types of vcSignals.
See in: Overview
Module: vcBehaviors
Parent: vcBehavior
Children: vcBooleanSignalMap
Referenced by: -
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Direction | vcSignalMapDirection | R | Gets the direction of ports in the signal map.See morePorts can be set as inputs, outputs or undefined. If ports are defined as inputs, they cannot be used as outputs or vice versa. To set the direction use the trySetDirection Method. |
| Listeners | vcList | RW | Gets or sets a list of behaviors using the signal map. |
| MaxPortCount | Integer | RW | Gets or sets maximum number of ports in the map. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| addPort | None | Integer index, vcSignal signal | Connects a port at a given index to a given signal. The port index starts from 0. See moreThe PortCount property should have enough ports. In other words, to add a boolean signal to port 3 the PortCount value should be at least 4 (ports 0-3), otherwise calling this method will return an error. Parameters: index (int): Port index. signal (vcSignal): Target signal. Exceptions: RuntimeError: When value of the index or signal is incorrect. RuntimeError: When given parameters are not correct. |
| getPortName | String | Integer index | Returns the name of a port at a given index.See moreNote: If the port has no signal then its name is an empty string. Parameters: index (int): Index of the port in the map. Returns: String: Name of the port. Exceptions: RuntimeError: When value of the index is incorrect. |
| setPortName | None | Integer index, String name | Sets the name of a port at a given index to a given name. Note: The port must have a signal in order to be assigned a name. See moreParameters: index (int): Index of the port. name (str): Name to set. Exceptions: RuntimeError: When value of the index is incorrect. |
| trySetDirection | Boolean | vcSignalMapDirection type | Tries to set a direction for this Signal Map.See moreParameters: type (vcSignalMapDirection): Type of the direction to set. Returns: Boolean: If setting the direction was successful, returns True. Otherwise, returns False. Exceptions: RuntimeError: When value of the index is incorrect. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnDirectionChanged | vcSignalMap signalMap, vcSignalMapDirection oldValue, vcSignalMapDirection newValue | Triggered when the value of the Direction property is changed.See moreParameters: signalMap (vcSignalMap): Signal map that triggered the event. oldValue (vcSignalMapDirection): Old value of the direction. newValue (vcSignalMapDirection): New value of the direction. |